package com.itheima.demo01;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.function.Function;
import java.util.stream.Stream;

public class Test03 {
    public static void main(String[] args) {

        ArrayList<String> list = new ArrayList<>();
        list.add("zhangsan,23");
        list.add("lisi,23");
        list.add("wangwu,23");
      /*  list.add(new Student("zhangsan",23));
        list.add(new Student("lisi",23));
        list.add(new Student("wangwu",23));*/

      /*  Stream<String> stringStream = list.stream().map(Student::new).map(new Function<Student, String>() {
            @Override
            public String apply(Student s) {
                return s.getName();
            }
        });*/
        Stream<String> stringStream = list.stream().map(Student::new).map(Student::getName);

        System.out.println(Arrays.toString(stringStream.toArray()));


    }
}
